#include "hplcqinfinecollectorsendpacket.h"
#include "hplcqinfinecollectorprotocoldata.h"
#include "common/hplcqinfinepfcid.h"
#include "common/hplcqinfinemakepacket.h"

namespace hplc
{
namespace qinfine
{

HplcQinfineCollectorSendPacket::HplcQinfineCollectorSendPacket(HplcQinfineCollectorProtocolData &data, QObject *parent)
    : HplcQinfineSendCommonPacket (data, parent)
{

}

HplcQinfineCollectorSendPacket::~HplcQinfineCollectorSendPacket()
{

}

void HplcQinfineCollectorSendPacket::setChannel(uint8_t channel)
{
    HplcQinfineCollectorProtocolData *m_d = static_cast<HplcQinfineCollectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_COLLECTOR_CHANNEL), channel);
    m_d->m_checker->sendRetry();
}

void HplcQinfineCollectorSendPacket::getChannel()
{
    HplcQinfineCollectorProtocolData *m_d = static_cast<HplcQinfineCollectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_COLLECTOR_CHANNEL));
    m_d->m_checker->sendRetry();
}

void HplcQinfineCollectorSendPacket::setBottleNumber(uint16_t number)
{
    HplcQinfineCollectorProtocolData *m_d = static_cast<HplcQinfineCollectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_COLLECTOR_BOTTLE_NUMBER), number);
    m_d->m_checker->sendRetry();
}

void HplcQinfineCollectorSendPacket::getBottleNumber()
{
    HplcQinfineCollectorProtocolData *m_d = static_cast<HplcQinfineCollectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_COLLECTOR_BOTTLE_NUMBER));
    m_d->m_checker->sendRetry();
}

void HplcQinfineCollectorSendPacket::setStartStop(uint8_t isStart)
{
    HplcQinfineCollectorProtocolData *m_d = static_cast<HplcQinfineCollectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_COLLECTOR_START_STOP), isStart);
    m_d->m_checker->sendRetry();
}

void HplcQinfineCollectorSendPacket::getStartStop()
{
    HplcQinfineCollectorProtocolData *m_d = static_cast<HplcQinfineCollectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_COLLECTOR_START_STOP));
    m_d->m_checker->sendRetry();
}

void HplcQinfineCollectorSendPacket::setNumberPattern(uint8_t pattern)
{
    HplcQinfineCollectorProtocolData *m_d = static_cast<HplcQinfineCollectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_COLLECTOR_NUMBER_PATTERN), pattern);
    m_d->m_checker->sendRetry();
}

void HplcQinfineCollectorSendPacket::getNumberPattern()
{
    HplcQinfineCollectorProtocolData *m_d = static_cast<HplcQinfineCollectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_COLLECTOR_NUMBER_PATTERN));
    m_d->m_checker->sendRetry();
}

void HplcQinfineCollectorSendPacket::setPrevStart()
{
    HplcQinfineCollectorProtocolData *m_d = static_cast<HplcQinfineCollectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_COLLECTOR_PREV_START));
    m_d->m_checker->sendRetry();
}

void HplcQinfineCollectorSendPacket::setNextStart()
{
    HplcQinfineCollectorProtocolData *m_d = static_cast<HplcQinfineCollectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_COLLECTOR_NEXT_START));
    m_d->m_checker->sendRetry();
}

} // qinfine
} // hplc
